package remato.client.view.session;


import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;

import remato.client.controller.RequirementPlugin;
import remato.client.view.util.ViewerAction;

/**
 * 
 * @author Petter L. H. Eide
 * @version $Id: LoginAction.java,v 1.1 2006-01-23 19:58:36 petterei Exp $
 */
public class LoginAction extends ViewerAction{

    private LoginDialog loginDialog;
    
    public LoginAction(IWorkbenchWindow window) {
        super("Login");
        init(window) ;
        setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_DEF_VIEW));
    }

    public void init(IWorkbenchWindow window) {
        loginDialog = new LoginDialog(window.getShell(), RequirementPlugin.getInstance());
        setToolTipText("Log in to server.");
    }

    @Override
    public void run() {
        loginDialog.open();
        RequirementPlugin.getInstance().notifyModelChanged(null);
        super.run();
    }

}
/**
 * Changelog:
 * 
 * $Log: LoginAction.java,v $
 * Revision 1.1  2006-01-23 19:58:36  petterei
 * initial commit for client, fitting the alternative session implementation
 *
 * Revision 1.1  2005-10-02 21:31:16  petterei
 * client with new domain model
 *
 * Revision 1.1  2005/09/27 17:04:29  petterei
 * inittial commit
 *
 * Revision 1.1  2005/08/23 06:36:39  peide3
 * new actions
 *
 * Revision 1.1  2005/07/31 22:55:10  petterei
 * initial commit
 *
 */